package com.cennavi.mm.service;

import java.io.Serializable;

import com.vividsolutions.jts.geom.Point;

/**
 * GPS 到 link到投影对象
 * @author hadoop
 *
 */
public class Gps2Projection implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 所投影到的link的ID
	 */
	private String linkID;
	/**
	 * 所投影到的link的snode ID
	 */	
	private String snode;
	/**
	 * 所投影到的link到enode ID
	 */	
	private String enode;	
	
	private double linkLenth;
	
	/*
	 * 速度，单位:米/每秒
	 */
	private float speedlimit;
		
	/*
	 * 道路等级R表Kind前两位
	 */
	private String roadclass;
	
	/*
	 * 道路属性R表Kind后两位
	 */
	private String roadtype;	 
	
	
	/**
	 * 投影到的link上的点的位置
	 */
	private Point prjection;
	
	/**
	 * GPS点和投影到link上的点直接到距离
	 */
	private double prjDistance;	
	
	/**
	 * 投影点距离link起始点的距离
	 */
	private double prjDistanceFormSNode;
	
	/**
	 * 投影到的link的linesgement的方位角
	 */
	private double azimuth;
	
	/** GPS的方位角和投影到的link的linesgement的方位角之间到角度差	 */
	private double azimuthDelta=0;
	
	/** 权重	 */
	private double cost;
	
	
	/**考虑GPS方位角的投影计算结果
	 * @param linkID
	 * @param linkLenth
	 * @param snode
	 * @param enode
	 * @param prjection
	 * @param prjDistance
	 * @param prjDistanceFormSNode
	 * @param azimuth
	 * @param azimuthDelta
	 */
	public Gps2Projection(
			String linkID,double linkLenth, String snode, String enode, 
			float speedlimit,String roadclass,String roadtype,
			Point prjection,double prjDistance, double prjDistanceFormSNode, double azimuth,
			double azimuthDelta) {
		this.linkID = linkID;
		this.linkLenth=linkLenth;
		this.snode = snode;
		this.enode = enode;
		this.speedlimit=speedlimit;
		this.roadclass=roadclass;
		this.roadtype=roadtype;		
		this.prjection = prjection;
		this.prjDistance = prjDistance;
		this.prjDistanceFormSNode = prjDistanceFormSNode;
		this.azimuth = azimuth;
		this.azimuthDelta = azimuthDelta;
	}
	
	
	/**不考虑GPS方位角的投影计算结果
	 * 方位角和方位角差默认为负无穷大
	 * @param linkID
	 * @param linkLenth
	 * @param snode
	 * @param enode
	 * @param prjection
	 * @param prjDistance
	 * @param prjDistanceFormSNode
	 *
	 */
	public Gps2Projection(
			String linkID,double linkLenth, String snode, String enode, 
			float speedlimit,String roadclass,String roadtype,
			Point prjection,double prjDistance, double prjDistanceFormSNode) {
		this.linkID = linkID;
		this.linkLenth=linkLenth;
		this.snode = snode;
		this.enode = enode;
		this.speedlimit=speedlimit;
		this.roadclass=roadclass;
		this.roadtype=roadtype;
		this.prjection = prjection;
		this.prjDistance = prjDistance;
		this.prjDistanceFormSNode = prjDistanceFormSNode;
		this.azimuth = Double.NEGATIVE_INFINITY;
		this.azimuthDelta = Double.NEGATIVE_INFINITY;
	}

	public String getLinkID() {
		return linkID;
	}

	public double getLinkLenth() {
		return linkLenth;
	}


	public String getSnode() {
		return snode;
	}

	public String getEnode() {
		return enode;
	}

	public Point getPrjection() {
		return prjection;
	}

	public double getPrjDistance() {
		return prjDistance;
	}

	public double getPrjDistanceFormSNode() {
		return prjDistanceFormSNode;
	}

	public double getAzimuth() {
		return azimuth;
	}

	public double getAzimuthDelta() {
		return azimuthDelta;
	}

	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}


	public float getSpeedlimit() {
		return speedlimit;
	}


	public String getRoadclass() {
		return roadclass;
	}


	public String getRoadtype() {
		return roadtype;
	} 	
	
	
}
